home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Linux
/
Kubuntu 8.10
/
kubuntu-8.10-desktop-i386.iso
/
casper
/
filesystem.squashfs
/
etc
/
init.d
/
brltty
< prev
next >
Wrap
Text File
|
2008-08-06
|
2KB
|
81 lines
#! /bin/sh
### BEGIN INIT INFO
# Provides: brltty
# Required-Start: mountkernfs udev
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Braille terminal driver
# Description: Used to provide access to refreshable braille terminals.
### END INIT INFO
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/sbin/brltty
NAME=brltty
DESC='Braille terminal driver'
test -f $DAEMON || exit 0
# /etc/brltty.conf may need to be propagated from the initramfs. (This is a
# pretty awful hack.)
if [ -e /dev/.initramfs/brltty.conf ] && [ -e /etc/default/brltty ]; then
if [ -e /etc/brltty.conf ]; then
mv /etc/brltty.conf /etc/brltty.conf.orig
fi
mv /dev/.initramfs/brltty.conf /etc/brltty.conf
sed -i -e 's/^RUN_BRLTTY=.*/RUN_BRLTTY=yes/' /etc/default/brltty
fi
[ ! -f /etc/default/brltty ] || . /etc/default/brltty
# Edit /etc/default/brltty and set RUN_BRLTTY=yes to allow brltty to be
# started.
if [ "$RUN_BRLTTY" != yes ]; then
exit 0
fi
set -e
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
if start-stop-daemon --start --oknodo --exec $DAEMON -- -q; then
log_end_msg 0
else
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
if start-stop-daemon --stop --quiet --oknodo --retry 5 --exec $DAEMON; then
log_end_msg 0
else
log_end_msg 1
fi
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
start-stop-daemon --stop --quiet --retry 5 --exec $DAEMON
if start-stop-daemon --start --quiet --exec $DAEMON -- -q; then
log_end_msg 0
else
log_end_msg 1
fi
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0